/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.file.utils.FileUploadUtils;
import com.jeesite.modules.goods.dao.ZtQuanselfDao;
import com.jeesite.modules.goods.entity.ZtGoods;
import com.jeesite.modules.goods.entity.ZtQuanself;

/**
 * 测试数据Service
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Service
@Transactional(readOnly = true)
public class ZtQuanselfService extends CrudService<ZtQuanselfDao, ZtQuanself> {
	
	/**
	 * 获取单条数据
	 * 
	 * @param testData
	 * @return
	 */
	@Override
	public ZtQuanself get(ZtQuanself ztQuanself) {
		ZtQuanself entity = super.get(ztQuanself);
		if (entity == null) {
			entity = new ZtQuanself();
		}
		return entity;
	}
	public ZtQuanself getByAdmin(ZtQuanself ztQuanself) {
		return dao.getByAdmin(ztQuanself);
	}
	public ZtQuanself getStatus(ZtQuanself ztQuanself) {
		return dao.getStatus(ztQuanself);
	}
	

	/**
	 * 查询分页数据
	 * 
	 * @param page
	 *            分页对象
	 * @param testData
	 * @return
	 */
	@Override
	public Page<ZtQuanself> findPage(Page<ZtQuanself> page, ZtQuanself ztQuanself) {
		return super.findPage(page, ztQuanself);
	}

	/**
	 * 保存数据（插入或更新）
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void save(ZtQuanself ztQuanself) {
		super.save(ztQuanself);
		// 保存上传图片
				FileUploadUtils.saveFileUpload(ztQuanself.getId(), "testData_image");
	}

	/**
	 * 更新状态
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void updateStatus(ZtQuanself ztQuanself) {
		super.updateStatus(ztQuanself);
	}


	/**
	 * 删除数据
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void delete(ZtQuanself ztQuanself) {
		super.delete(ztQuanself);
	}

}